<!DOCTYPE html>
<html lang="zh">
<head>
    <title>权限管理 - virus CMS</title>
    {include file="common/meta" /}
</head>
<body>

<!-- Navbar -->
{include file="common/header" /}
<!-- /Navbar -->
<!-- Main Container -->
<div class="main-container container-fluid">
    <!-- Page Container -->
    <div class="page-container">

        <!-- Page Sidebar -->
        {include file="common/sidebar" /}
        <!-- /Page Sidebar -->
        <!-- Page Content -->
        <div class="page-content">
            <!-- Page Breadcrumb -->
            <div class="page-breadcrumbs">
                <ul class="breadcrumb">
                    <li class="active">
                        <i class="fa fa-home"></i>&nbsp;控制面板
                    </li>
                    <li>
                        <i class="fa fa-send"></i> CMS管理
                    </li>
                    <li>
                        <i class=""></i> 文章列表
                    </li>
                </ul>
            </div>
            <!-- /Page Breadcrumb -->
            <!-- Page Body -->
            <div class="page-body">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">文章列表</h3>
                            </div>
                            <div class="panel-body">
                                <div class="row margin-top-5">
                                    <div class="col-sm-12">
                                        <table class="table table-bordered table-responsive table-hover">
                                            <thead>
                                            <tr>
                                                <th>#ID</th>
                                                <th>标题</th>
                                                <th>作者</th>
                                                <th>状态</th>
                                                <th>创建时间</th>
                                                <th>操作</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            {volist name="list" id="vo"}
                                                <tr>
                                                    <td>{$vo.id}</td>
                                                    <td>{$vo.title}</td>
                                                    <td>{$vo.user_id}</td>
                                                    <td>{$vo.status}</td>
                                                    <td>{$vo.create_time}</td>
                                                    <td>
                                                        <a href="{:url('admin/Article/read', array('id' => $vo.id))}" class="btn btn-primary">查看详情</a>
                                                        <a href="{:url('admin/Article/check', array('id' => $vo.id))}" class="btn btn-success">审核</a>
                                                        <a href="{:url('admin/Article/delete', array('id' => $vo.id))}" class="btn btn-danger">删除</a>
                                                    </td>
                                                </tr>
                                            {/volist}
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->

    </div>
    <!-- /Page Container -->
    <!-- Main Container -->

</div>

{include file="common/script" /}
<script type="text/javascript">
    function confirm_msg(obj, msg = '') {
        var id = $(obj).attr('data-id');
        var url = "/admin/Group/delete";
        confirm(msg, "你将失去这条数据", function (isConfirm) {
            if (isConfirm) {
                $.post(url, {id: id}, function (data) {
                    if (data.code === 1) {
                        alert(data.msg, ":)", function () {
                            setTimeout(function () {
                                location.href = '/admin/Group/index';
                            }, 2000);
                        }, {type: 'success', confirmButtonText: 'OK'});
                    } else {
                        alert(data.msg, ":)", function () {
                            setTimeout(function () {
                                location.href = '/admin/Rule/index';
                            }, 2000);
                        }, {type: 'error', confirmButtonText: 'OK'});
                    }
                }, 'json');
            } else {
                return false;
            }
        }, {confirmButtonText: '确定', cancelButtonText: '取消', width: 400});
    }
</script>
</body>
<!--  /Body -->
</html>
